{{template "header" .}}	
	<title>修改分类</title>
</head>
<body>
{{template "navigation" .}}	
<!--<div class="container" style="margin:150px;width:1000px">-->
<div class="container" style="margin-top:100px">
	<h1>修改分类</h1>
	<form method="POST" action="/category">
		<div class="form-group">
			<label>原分类名称 - {{.Category.Title}}</label>
			<input id="category" class="form-control" type="" name="CategoryName" placeholder="请输入新的分类名称" >
		</div>
		<input type="hidden" name="CategoryId" value={{.Category.Id}}>
		<button class="btn-default" type="submit" onclick="return checkinput();">提交修改</button>
		<button class="btn-default" onclick="return backtohome()">返回</button>
	</form>
	<script type="text/javascript">
		function checkinput(){
			var name = document.getElementById("category");
			if (name.value.length == 0){
				alert("请输入名称");
				return false;
			}
			return true;
		}
		function backtohome(){
			window.location.href = "/category";
			return false;
		}
	</script>
</div>
</body>
</html>
